<template>
  <a-rate v-model="val" allow-half />
</template>

<script>
export default {
  model: {
    prop: 'modelVal',
    event: 'change'
  },
  props: {
    modelVal: {
      type: Number,
      default: 0
    }
  },
  data () {
    return {
      val: 0
    }
  },
  mounted () {
    this.val = this.modelVal
  },
  watch: {
    modelVal (v) {
      this.val = v
    },
    val (v) {
      this.$emit('change', v)
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
